<template>
  <div class="admin-container">
    <!-- <div class="container">
      <div class="admin">
        <div class="menu">
          <el-container style="height: 500px; border: 1px solid #eee">
            <el-aside>
              <el-menu
                default-active="2"
                class="el-menu-vertical-demo">
                <el-menu-item index="1">
                  <i class="el-icon-menu"></i>
                  <span slot="title">商品管理</span>
                </el-menu-item>
                <el-menu-item index="2" @click="logout">
                  <i class="el-icon-menu"></i>
                  <span slot="title">注销</span>
                </el-menu-item>
              </el-menu>
            </el-aside>
            <el-container>
              <el-main>
                <el-table
                  :data="tableData"
                  style="width: 100%">
                  <el-table-column
                    prop="id"
                    label="编号"
                    type='index'>
                  </el-table-column>
                  <el-table-column
                    prop="name"
                    label="商品名称">
                  </el-table-column>
                  <el-table-column
                    label="商品图片">
                    <template slot-scope="scope">
                      <el-image :src="scope.row.img">
                      </el-image>
                    </template>
                  </el-table-column>
                  <el-table-column
                    prop="price"
                    label="商品价格">
                  </el-table-column>
                  <el-table-column
                    prop="createdAt"
                    label="发布日期">
                  </el-table-column>
                  <el-table-column
                    prop="user.username"
                    label="发布人">
                  </el-table-column>
                  <el-table-column
                    label="操作">
                    <template slot-scope="scope">
                      <el-popconfirm
                        title="确定删除该商品吗？"
                        @confirm="confirm(scope.row.id)"
                        confirm-button-type='danger'
                        cancel-button-type='primary'>
                        <el-button type="danger" slot="reference">删除商品</el-button>
                      </el-popconfirm>
                    </template>
                  </el-table-column>
                </el-table>
              </el-main>
            </el-container>
          </el-container>
        </div>
      </div>
    </div> -->
  </div>
</template>

// <script>
// import {getAllGood} from '@/api/admin/index.js'
// import {delGood} from '@/api/admin/index.js'
// import {delCollection} from '@/api/admin/index.js'
// export default {
//   data() {
//     return {
//       tableData:[]
//     }
//   },
//   methods:{
//     init() {
//       // console.log(localStorage.getItem('adminor'));
//       getAllGood().then(res=>{
//         console.log(res.data);
//         this.tableData = res.data.data
//       })
//     },
//     confirm(id) {
//       console.log(id);
//         delGood(id).then(() => {
//           this.init()
//         })
//         delCollection(id).then(() => {
//           this.init()
//         })
//     },
//     logout() {
//       localStorage.clear()
//       this.$router.push('/login')
//     }
//   },
//   created() {
//     this.init()
//   }
// }
// </script>

<style scoped>

</style>